package com.wzq.app.utils.permission;

import android.app.Activity;

/**
 * 检查权限的监听器
 */
public interface PermissionListener {

    /**
     * 所有权限获得授权时，调用
     *
     * @param act
     * @param requestCode
     * @param grantResults
     * @param permissions
     */
    void onPermissionsGranted(Activity act, int requestCode, int[] grantResults, String... permissions);

    /**
     * 有一个或多个权限被拒绝时，调用
     *
     * @param act
     * @param requestCode
     * @param grantResults
     * @param permissions
     */
    void onPermissionsDenied(Activity act, int requestCode, int[] grantResults, String... permissions);

    /**
     * 是否显示权限的说明（为什么需要这个权限）
     *
     * @param act
     * @param requestCode
     * @param isShowRationale
     * @param permissions
     */
    void onShowRequestPermissionRationale(Activity act, int requestCode, boolean isShowRationale, String... permissions);

    /**
     * 出现错误时，调用
     *
     * @param act
     * @param requestCode
     * @param grantResults
     * @param errorMsg
     * @param permissions
     */
    void onPermissionsError(Activity act, int requestCode, int[] grantResults, String errorMsg, String... permissions);

}
